package com.agua.enturno.vista.modelos;

import org.apache.wicket.model.IModel;
import org.joda.time.LocalTime;


public class LocalTimeModel implements IModel<String> {
	
	private static final long serialVersionUID = 1L;
	
	private IModel<LocalTime> localTimeModel;
	
	public LocalTimeModel(IModel<LocalTime> localTimeModel) {
		this.localTimeModel = localTimeModel;
	}

	@Override
	public void detach() {
		localTimeModel.detach();
	}

	@Override
	public String getObject() {
		return localTimeModel.getObject().toString();
	}

	@Override
	public void setObject(String object) {
		this.localTimeModel.setObject(LocalTime.parse(object));
	}
	
}
